<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
</head>

<body>
<script> 
       function submitForm() { 
           document.select.action="saveConfigure.jsp"; 
           document.select.submit();
           return true;
       }
       
       function download() { 
           document.select.action="download.jsp"; 
           document.select.submit();
           return true;
       } 
</script>

<jsp:useBean id="user" class="confInfo.UserInfoBean" scope= "session">
	<jsp:setProperty property="*" name="user"/>
</jsp:useBean>
<form action="" name="select" id="select" method="post">
	<input type="hidden" name="submitted" value="true">
	<%
	user.setContext(pageContext);
	%>
	<table>
	<c:if test="${param.submitted&&user.xmlGenerated}">
		<tr>
			<td></td>
			<td>
			xml has been generated!
			</td>
		</tr>
	</c:if>
		<tr>
			<td>startUrl:<%-- c:out value="${param.submitted}+${user.xmlGenerated}"/ --%></td>
			<td><input type="text" name="startUrl" value="<c:out value="${user.startUrl}"/>">
			</td>
		</tr>
		<tr>
			<td>pattern:</td>
			<td><input type="text" name="pattern" value="<c:out value="${user.pattern}"/>">
			</td>
		</tr>
		
<%-- 	<tr>
			<td>configure file name:</td>
			<td><input type="text" name="configFile" value="<c:out value="${user.configFile}"/>">
			</td>
		</tr>
--%>
		<tr>
			<td colspan=2>
				<input type="submit" value="save configure" onclick="submitForm()">
			</td>
		</tr>
		<tr>
			<td colspan=2>
				<input type="submit" value="download configure" onclick="download()">
			</td>
		</tr>
	</table>
</form>

<FORM METHOD="POST" ENCTYPE="multipart/form-data" ACTION="upload.jsp">
	<INPUT TYPE="FILE" NAME="MYFILE">
	<INPUT TYPE="SUBMIT" name="upload" value="upload">
</FORM>

<c:out value="${user.basePath}"></c:out>

</body>

</html>